<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->char('uuid',64)->default("")->comment("用户唯一ID");
            $table->char('resource_uuid',64)->default("")->comment("邀请用户的id");
            $table->string('name',60)->default("")->comment("昵称");
            $table->string('initial',60)->default('')->comment('首字母大写');
            $table->string('pinyin',60)->default('')->comment('拼音');
            $table->string('avatar',255)->default("")->comment("头像");
            $table->string('avatar_thumb',255)->default("")->comment("头像缩略图");
            $table->string('tags',128)->default("")->comment("兴趣code分割值");
            $table->enum('gender',["WOMAN","MAN"])->default("WOMAN")->comment("性别");
            $table->date('solar_birthday')->comment("公历生日");
            $table->char('lunar_birthday',8)->comment("农历生日");
            $table->string('time_period', 16)->comment("出生时间");
            $table->string('area_code', 20)->default("")->comment('地区code');
            $table->string('phone',11)->default("")->comment("用户手机号");
            $table->string('email',60)->default("")->comment("用户邮箱");
            $table->timestamps();
            $table->softDeletes();
            $table->engine = 'InnoDB';
            $table->charset = 'utf8';
            $table->collation='utf8_general_ci';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
